<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      position: relative;
      margin: 100px auto;
      width: 520px;
      height: 104px;
      display: flex;
      border: 2px solid black;
      overflow: hidden;
    }

    .viewpage {
      position: absolute;
      display: flex;
      width: 1040px;
      height: 104px;
      left: -520px;
      top: 0;
      animation: move 4s linear infinite reverse;
    }

    @keyframes move {
      0% {
        left: -100%;
      }

      100% {
        left: 0%;
      }
    }

    .box span {
      text-align: center;
      line-height: 100px;
      display: block;
      width: 100px;
      height: 100px;
      background-color: black;
      color: white;
      font-size: 50px;
      border: 2px solid white;
    }
  </style>
</head>

<body>
  <div class="box">
    <div class="viewpage">
      <span>1</span>
      <span>2</span>
      <span>3</span>
      <span>4</span>
      <span>5</span>
      <span>1</span>
      <span>2</span>
      <span>3</span>
      <span>4</span>
      <span>5</span>
    </div>
  </div>
</body>

</html>